/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // const auth = middleware.auth();
  // router.get('/', controller.home.index);
  router.prefix('/api/v1');

  // 用户频道
  router.post('/users', controller.user.create);
  router.post('/users/login', controller.user.login);
  router.get('/users/info/:userid', app.middleware.auth({ required: false }), controller.user.userinfo);
  router.get('/users/subscribe/:subscribeid', app.middleware.auth(), controller.user.subscribe);

  // 视频管理
  router.get('/video/getvod', app.middleware.auth(), controller.vod.getvod);
  router.get('/video/getvideo/:videoid', controller.vod.getvideo);
  router.post('/video/comment/:videoid', app.middleware.auth(), controller.video.createComment);
  router.get('/video/gethots', controller.video.gethots);

};
